package com.lesama.object.equals;

import com.lesama.object.Student;

/*
    public boolean equals(Object obj) {
        return (this == obj);
    }
    Object类中的equals方法，进行对象之间的比较
    默认按照对象的内存地址比较
    可以重写Object类中的equals方法让对象之间进行内容的比较
 */

public class EqualsDemo {
    public static void main(String[] args) {
        Student stu1 = new Student("张三", 24);
        Student stu2 = new Student("张三", 24);
        System.out.println(stu2 == stu1);
        System.out.println(stu1.equals(stu2));
    }
}
